﻿using System;

namespace DesignPattern.com.state.scene {
    public class BattleState : SceneState {
        public static bool flag;

        public BattleState(SceneController sc) : base(sc){
            StateName = "battleState";
        }

        public override void stateBegin(){
            Console.WriteLine("PBaseDefenseGame.Instance.Init()");
        }

        public override void stateEnd(){
            Console.WriteLine("PBaseDefenseGame.Instance.Release()");
        }

        public override void stateUpdate(){
            Console.WriteLine("==BattleState-stateUpdate()");

            InputProcess();

            Console.WriteLine("更新游戏逻辑 PBaseDefenseGame.Instance.Update()");

            Console.WriteLine("judg game is over="+flag);
            if (flag)
                sc.setState(new MenuState(sc), "MenuState");
        }

        private void InputProcess(){
            Console.WriteLine("获取输入 process input");
        }
    }
}